<template>
  <div>
    <Chart :cdata="cdata" />
  </div>
</template>

<script>
import Chart from './chart.vue';
import { queryPartyMemberNum } from "../../../../api/index.js";
export default {
  data() {
    return {
      cdata: {
        xData: ["正式党员", "预备党员", "发展对象", "积极分子", "团员", "群众"],
        seriesData: [
          { value: 10, name: "正式党员" },
          { value: 25, name: "预备党员" },
          { value: 55, name: "发展对象" },
          { value: 15, name: "积极分子" },
          { value: 25, name: "团员" },
          { value: 15, name: "群众" },
        ]
      }
    }
  },
  components: {
    Chart,
  },
  mounted() {
    this.getData()
  },
  methods: {
    getData() {
      let that = this;
      queryPartyMemberNum().then(res => {
        that.cdata.seriesData[0].value = res.data.partyMember
        that.cdata.seriesData[1].value = res.data.probationary
        that.cdata.seriesData[2].value = res.data.development
        that.cdata.seriesData[3].value = res.data.activists
        that.cdata.seriesData[4].value = res.data.league
        that.cdata.seriesData[5].value = res.data.crowd
      })
    }
  }
}
</script>

<style lang="scss" scoped>
</style>